﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using DomainDriver.CommonUtilities.Enums;
using DomainDriver.DomainModeling.DomainObjects;
using AutomotivePricingModel.BodyStyles;
using AutomotivePricingModel.DriveTrainTypes;
using AutomotivePricingModel.TransmissionTypes;

namespace AutomotivePricingModel.Vehicles
{
    [ComplexType]
    public partial class OptionsConfiguration : DomainObjectBase<OptionsConfiguration>
    {
        private BodyStyleEnum m_BodyStyle;
        private DriveTrainTypeEnum m_DriveTrainType;
        private TransmissionTypeEnum m_TransmissionType;
        private bool m_HasNavigationSystem;
        private int m_NumberOfSpeeds;
        private int m_NumberOfCylinders;
        private double m_EngineSizeInLiters;

        public OptionsConfiguration()
        {
            m_BodyStyle = (BodyStyleEnum)EnumUtilities.GetMinEnumValue<BodyStyleEnum>();
            m_DriveTrainType = (DriveTrainTypeEnum)EnumUtilities.GetMinEnumValue<DriveTrainTypeEnum>();
            m_TransmissionType = (TransmissionTypeEnum)EnumUtilities.GetMinEnumValue<TransmissionTypeEnum>();
            m_HasNavigationSystem = false;
            m_NumberOfSpeeds = 5;
            m_NumberOfCylinders = 4;
            m_EngineSizeInLiters = 1.8;
        }

        public BodyStyleEnum BodyStyle
        {
            get { return m_BodyStyle; }
            set { m_BodyStyle = value; }
        }

        public DriveTrainTypeEnum DriveTrainType
        {
            get { return m_DriveTrainType; }
            set { m_DriveTrainType = value; }
        }

        public TransmissionTypeEnum TransmissionType
        {
            get { return m_TransmissionType; }
            set { m_TransmissionType = value; }
        }

        public bool HasNavigationSystem
        {
            get { return m_HasNavigationSystem; }
            set { m_HasNavigationSystem = value; }
        }

        public int NumberOfSpeeds
        {
            get { return m_NumberOfSpeeds; }
            set { m_NumberOfSpeeds = value; }
        }

        public int NumberOfCylinders
        {
            get { return m_NumberOfCylinders; }
            set { m_NumberOfCylinders = value; }
        }

        public double EngineSizeInLiters
        {
            get { return m_EngineSizeInLiters; }
            set { m_EngineSizeInLiters = value; }
        }

        #region DomainObject Methods

        public override OptionsConfiguration Copy()
        {
            OptionsConfiguration copy = new OptionsConfiguration();
            CopyTo(copy);
            return copy;
        }

        public override void CopyTo(OptionsConfiguration otherObject)
        {
            otherObject.m_BodyStyle = m_BodyStyle;
            otherObject.m_DriveTrainType = m_DriveTrainType;
            otherObject.m_TransmissionType = m_TransmissionType;
            otherObject.m_HasNavigationSystem = m_HasNavigationSystem;
            otherObject.m_NumberOfSpeeds = m_NumberOfSpeeds;
            otherObject.m_NumberOfCylinders = m_NumberOfCylinders;
            otherObject.m_EngineSizeInLiters = m_EngineSizeInLiters;
        }

        public override bool Equals(OptionsConfiguration otherObject)
        {
            if (otherObject.m_BodyStyle != m_BodyStyle)
            { return false; }
            if (otherObject.m_DriveTrainType != m_DriveTrainType)
            { return false; }
            if (otherObject.m_TransmissionType != m_TransmissionType)
            { return false; }
            if (otherObject.m_HasNavigationSystem != m_HasNavigationSystem)
            { return false; }
            if (otherObject.m_NumberOfSpeeds != m_NumberOfSpeeds)
            { return false; }
            if (otherObject.m_NumberOfCylinders != m_NumberOfCylinders)
            { return false; }
            if (otherObject.m_EngineSizeInLiters != m_EngineSizeInLiters)
            { return false; }
            return true;
        }

        #endregion
    }
}